package com.zzyl.mapper;


import com.github.pagehelper.Page;
import com.zzyl.entity.NursingProject;
import com.zzyl.vo.NursingProjectVo;
import org.apache.ibatis.annotations.*;

import java.util.List;  
  
@Mapper // 如果使用MyBatis的注解方式，需要添加此注解  
public interface NursingProjectMapper {  
  
    // 插入操作  
    @Insert("INSERT INTO nursing_project(name, image, price, unit, status, order_no,nursing_requirement, create_by, update_by, create_time, update_time, remark) " +
            "VALUES(#{name}, #{image}, #{price}, #{unit}, #{status}, #{orderNo},#{nursingRequirement}, #{createBy}, #{updateBy}, #{createTime}, #{updateTime}, #{remark})")
    int insertNursingProject(NursingProject nursingProject);
  
    // 查询所有操作  
    @Select("SELECT * FROM nursing_project")  
    List<NursingProjectVo> selectAllNursingProjects();
  
    // 根据ID查询操作  
    @Select("SELECT * FROM nursing_project WHERE id = #{id}")  
    NursingProject selectNursingProjectById(Long id);
  
    // 更新操作
    void updateNursingProject(NursingProject nursingProject);
  
    // 删除操作  
    @Delete("DELETE FROM nursing_project WHERE id = #{id}")  
    int deleteNursingProjectById(Long id);
  
    // 分页条件查询
    Page<NursingProjectVo> searchByPage(@Param("name") String name, @Param("status") Integer status);

    /**
     * 启用与禁止
     * @param id
     * @param status
     */
    void idAndStatus(@Param("id") Long id,@Param("status") Integer status);
}